/**
 * 
 */
package com.teach.servlet.admin;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.teach.entity.User;
import com.teach.service.UserDisplayService;
import com.teach.service.impl.UserDisplayServiceImpl;

/**
 * @author Liulianqiu
 *2020年7月28日
 */
public class UserDisplayServlet extends HttpServlet{
	
	private UserDisplayService userService = new UserDisplayServiceImpl();
	
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int len = 10;
		try {
			len = Integer.valueOf(request.getParameter("num"));
		} catch (NumberFormatException e) {
			
		}
		List<User> list = userService.list(0,len);
		request.setAttribute("list", list);
//		System.out.println(request.getContextPath());
		request.getRequestDispatcher("/admin/table.jsp").forward(request, response);
	}

}
